< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03030103.xhp

(section: day) (bookmark: bm_id3153345)
Day function

Day 関数

Day Function [Runtime]
Day 関数 [実行時](hd_id3153345.1)

Returns a value that represents the day of the month based on a serial date number generated by DateSerial or DateValue.
DateSerial ないし DateValue 関数による日付データのシリアル変換値を基に、該当する日を返します。(par_id3147560.2)

(/section: day)

Syntax:
構文:(hd_id3149456.3)

Day (Number)
Day (Number)(par_id3150358.4)

Return value:
戻り値:(hd_id3148798.5)

Integer
整数(par_id3125865.6)

Parameters:
パラメータ:(hd_id3150448.7)

Number: A numeric expression that contains a serial date number from which you can determine the day of the month.
Number: 日情報を得る日付データのシリアル変換値を示す数値表式。(par_id3156423.8)

This function is basically the opposite of the DateSerial function, returning the day of the month from a serial date number generated by the DateSerial or the DateValue function. For example, the expression
この関数は基本的に DateSerial 関数と逆方向の機能を担っており、DateSerialDateValue 関数による日付データのシリアル変換値を基に、該当する日を返します。こうした点は、下記のコードを実行してみると分かりやすいでしょう。(par_id3145786.9)

Print Day (DateSerial(1994, 12, 20))
Print Day(DateSerial(1994, 12, 20))(par_id3145364.10)

returns the value 20.
この場合の戻り値は 20 となります。(par_id3153190.11)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3149481.12)

sub ExampleDay
sub ExampleDay(par_id3155413.13)

Print "Day " & Day(DateSerial(1994, 12, 20)) & " of the month"
Print "Day " & Day(DateSerial(1994, 12, 20)) & " of the month"(par_id3149260.14)

end sub
end sub(par_id3148645.15)


< Prev / Next >